import 'package:dio/dio.dart';
import 'package:flutter_house_manager/constans/index.dart';
import 'package:flutter_house_manager/utils/RequestDio.dart';

// 1.获取房屋列表
Future<dynamic> getHouseListAPI() => requestDio.get(HTTP_PATH.HOUSE_LIST);

// 2. 添加房屋
Future<void> addHouseAPI(Map<String, dynamic> data) => requestDio.post(HTTP_PATH.HOUSE_LIST, data: data);

// 3. 上传图片
Future<dynamic> uploadPhotoAPI(FormData data) => requestDio.upload(HTTP_PATH.UPLOAD, data: data);

// 4. 获取房屋详情
Future<dynamic> getHouseDetailAPI(String id) => requestDio.get('${HTTP_PATH.HOUSE_LIST}/$id');

// 5. 删除房屋
Future<void> delHouseAPI(String id) => requestDio.delete('${HTTP_PATH.HOUSE_LIST}/$id');
